<?php

use yii\helpers\Html;
use kartik\daterange\DateRangePicker;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Topic */

$this->title = Yii::t('app', '创建话题');
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', '话题列表'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="topic-create">
    <h1><?= Html::encode($this->title) ?></h1>

    <div class="topic-form">
        <?php $form = ActiveForm::begin([
            'layout'=>'horizontal'
        ]);
        ?>
        <?= $form->field($model, 'topic_name')->textInput(['maxlength' => true]) ?>

        <?= $form->field($model, 'topic_author',[
            'template' => '{label}'.'<label class="control-label col-sm-9 " style="text-align:left"  for="topic-topic_author">'.$model->topic_author.'</label>'
        ]) ?>

        <?= $form->field($model, 'topic_des')->textarea(['maxlength' => true]) ?>

        <?= $form->field($model, 'topic_tags')->textInput(['maxlength' => true]) ?>
<!--    <?//= $form->field($model, 'updated_at')->label('更新时间')->textInput(['formart'=>'date','class'=>'sss'])  ?>    -->


        <?= $form->field($model, 'created_at')->widget(DateRangePicker::ClassName(),[
            'hideInput'=>true,
            'pluginOptions'=>[
                'singleDatePicker'=>true,
            ]
        ]) ?>



        <?= $form->field($model, 'topic_node_index')->textInput() ?>
        <?= $form->field($model, 'topic_node_time')?>

        <?= $form->field($model, 'topic_viewcount')->textInput() ?>

        <?= $form->field($model, 'topic_comment_id')->textInput() ?>

        <?= $form->field($model, 'topic_recommend_id')->textInput() ?>

        <div class="form-group">
            <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
        </div>

        <?php ActiveForm::end(); ?>

    </div>

</div>
